home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / MPW IIGS Interfaces / PIIGSIncludes / Windows.p < prev   
Encoding:
Text File  |  1990-08-01  |  12.4 KB  |  283 lines  |  [TEXT/MPS ]

  1. {********************************************
  2. ; File: Windows.p
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc. 1986-90
  6. ; All Rights Reserved
  7. ;
  8. ********************************************}
  9.  
  10. UNIT WINDOWS;
  11. INTERFACE
  12. USES TYPES,QUICKDRAW,EVENTS,CONTROLS;
  13. CONST
  14.  
  15.  
  16. { Error Codes }
  17. paramLenErr = $0E01;  { first word of parameter list is the wrong size }
  18. allocateErr = $0E02;  { unable to allocate window record }
  19. taskMaskErr = $0E03;  { bits 12-15 are not clear in WmTaskMask field of EventRecord }
  20.  
  21. { Axis Parameters }
  22. wNoConstraint = $0000;  { No constraint on movement. }
  23. wHAxisOnly = $0001;  { Horizontal axis only. }
  24. wVAxisOnly = $0002;  { Vertical axis only. }
  25.  
  26. { Desktop Command Codes }
  27. FromDesk = $00;  { Subtract region from desktop }
  28. ToDesk = $1;  { Add region to desktop }
  29. GetDesktop = $2;  { Get Handle of Desktop region }
  30. SetDesktop = $3;  { Set Handle of Desktop region }
  31. GetDeskPat = $4;  { Address of  pattern or drawing routine }
  32. SetDeskPat = $5;  { Change Address of  pattern or drawing routine }
  33. GetVisDesktop = $6;  { Get destop region less visible windows. }
  34. BackGroundRgn = $7;  { For drawing directly on desktop. }
  35.  
  36. { SendBehind Values }
  37. toBottom = $FFFFFFFE;  { To send window to bottom. }
  38. topMost = $FFFFFFFF;  { To make window top. }
  39. bottomMost = $0000;  { To make window bottom. }
  40.  
  41. { Task Masks }
  42. tmMenuKey = $00000001;
  43. tmUpdate = $00000002;
  44. tmFindW = $00000004;
  45. tmMenuSel = $0008;
  46. tmOpenNDA = $0010;
  47. tmSysClick = $0020;
  48. tmDragW = $0040;
  49. tmContent = $0080;
  50. tmClose = $0100;
  51. tmZoom = $0200;
  52. tmGrow = $0400;
  53. tmScroll = $0800;
  54. tmSpecial = $1000;
  55. tmCRedraw = $2000;
  56. tmInactive = $4000;
  57. tmInfo = $8000;
  58. tmContentControls = $00010000;
  59. tmControlKey = $00020000;
  60. tmControlMenu = $00040000;
  61. tmMultiClick = $00080000;
  62. tmIdleEvents = $00100000;
  63.  
  64. { TaskMaster Codes }
  65. wNoHit = $0000;  { retained for back compatibility.  }
  66. inNull = $0000;  { retained for back compatibility }
  67. inKey = $0003;  { retained for back compatibility }
  68. inButtDwn = $0001;  { retained for back compatibility }
  69. inUpdate = $0006;  { retained for back compatibility }
  70. wInDesk = $0010;  { On Desktop }
  71. wInMenuBar = $0011;  { On system menu bar }
  72. wClickCalled = $0012;  { system click called }
  73. wInContent = $0013;  { In content region }
  74. wInDrag = $0014;  { In drag region }
  75. wInGrow = $0015;  { In grow region, active window only }
  76. wInGoAway = $0016;  { In go-away region, active window only }
  77. wInZoom = $0017;  { In zoom region, active window only }
  78. wInInfo = $0018;  { In information bar }
  79. wInSpecial = $0019;  { Item ID selected was 250 - 255 }
  80. wInDeskItem = $001A;  { Item ID selected was 1 - 249 }
  81. wInFrame = $1B;  { in Frame, but not on anything else }
  82. wInactMenu = $1C;  { 'selection' of inactive menu item }
  83. wClosedNDA = $001D;  { desk accessory closed }
  84. wCalledSysEdit = $001E;  { inactive menu item selected }
  85. wInSysWindow = $8000;  { hi bit set for system windows }
  86.  
  87. { VarCode }
  88. wDraw = $00;  { Draw window frame command. }
  89. wHit = $01;  { Hit test command. }
  90. wCalcRgns = $02;  { Compute regions command. }
  91. wNew = $03;  { Initialization command. }
  92. wDispose = $04;  { Dispose command. }
  93.  
  94. { WFrame }
  95. fHilited = $0001;  { Window is highlighted. }
  96. fZoomed = $0002;  { Window is zoomed. }
  97. fAllocated = $0004;  { Window record was allocated. }
  98. fCtlTie = $0008;  { Window state tied to controls. }
  99. fInfo = $0010;  { Window has an information bar. }
  100. fVis = $0020;  { Window is visible. }
  101. fQContent = $0040;
  102. fMove = $0080;  { Window is movable. }
  103. fZoom = $0100;  { Window is zoomable. }
  104. fFlex = $0200;
  105. fGrow = $0400;  { Window has grow box. }
  106. fBScroll = $0800;  { Window has horizontal scroll bar. }
  107. fRScroll = $1000;  { Window has vertical scroll bar. }
  108. fAlert = $2000;
  109. fClose = $4000;  { Window has a close box. }
  110. fTitle = $8000;  { Window has a title bar. }
  111.  
  112. { Other Constants }
  113. windSize = $00D4;  { Size of WindRec. }
  114. wmTaskRecSize = $002E;  { Size of WmTaskRec. }
  115. wTrackZoom = $001F;
  116. wHitFrame = $0020;
  117. wInControl = $0021;
  118. wInControlMenu = $0022;
  119.  
  120. TYPE
  121. WmTaskRec = EventRecord ;
  122.  
  123.  
  124. WmTaskRecPtr = EventRecordPtr ;
  125.  
  126. WindColorHndl = ^WindColorPtr;
  127. WindColorPtr = ^WindColor;
  128. WindColor = RECORD
  129.     frameColor : Integer; { Color of window frame. }
  130.     titleColor : Integer; { Color of title and bar. }
  131.     tBarColor : Integer; { Color/pattern of title bar. }
  132.     growColor : Integer; { Color of grow box. }
  133.     infoColor : Integer; { Color of information bar. }
  134. END;
  135. WindRecPtr = ^WindRec;
  136. WindRec = RECORD
  137.     wNext : WindRecPtr;
  138.     port : GrafPort; { Window's port }
  139.     wDefProc : ProcPtr;
  140.     wRefCon : Longint;
  141.     wContDraw : ProcPtr;
  142.     wReserved : Longint; { Space for future expansion }
  143.     wStrucRgn : RegionHndl; { Region of frame plus content. }
  144.     wContRgn : RegionHndl; { Content region. }
  145.     wUpdateRgn : RegionHndl; { Update region. }
  146.     wControls : CtlRecHndl; { Window's control list. }
  147.     wFrameCtrls : CtlRecHndl; { Window frame's control list. }
  148.     wFrame : Integer;
  149. END;
  150. ParamListHndl = ^ParamListPtr;
  151. ParamListPtr = ^ParamList;
  152. ParamList = RECORD
  153.     paramLength : Integer; { Parameter to NewWindow.  }
  154.     wFrameBits : Integer; { Parameter to NewWindow. }
  155.     wTitle : Ptr; { Parameter to NewWindow. }
  156.     wRefCon : Longint; { Parameter to NewWindow. }
  157.     wZoom : Rect; { Parameter to NewWindow. }
  158.     wColor : WindColorPtr; { Parameter to NewWindow. }
  159.     wYOrigin : Integer; { Parameter to NewWindow. }
  160.     wXOrigin : Integer; { Parameter to NewWindow. }
  161.     wDataH : Integer; { Parameter to NewWindow. }
  162.     wDataW : Integer; { Parameter to NewWindow. }
  163.     wMaxH : Integer; { Parameter to NewWindow. }
  164.     wMaxW : Integer; { Parameter to NewWindow. }
  165.     wScrollVer : Integer; { Parameter to NewWindow. }
  166.     wScrollHor : Integer; { Parameter to NewWindow. }
  167.     wPageVer : Integer; { Parameter to NewWindow. }
  168.     wPageHor : Integer; { Parameter to NewWindow. }
  169.     wInfoRefCon : Longint; { Parameter to NewWindow. }
  170.     wInfoHeight : Integer; { height of information bar }
  171.     wFrameDefProc : LongProcPtr; { Parameter to NewWindow. }
  172.     wInfoDefProc : VoidProcPtr; { Parameter to NewWindow. }
  173.     wContDefProc : VoidProcPtr; { Parameter to NewWindow. }
  174.     wPosition : Rect; { Parameter to NewWindow. }
  175.     wPlane : WindowPtr; { Parameter to NewWindow. }
  176.     wStorage : WindRecPtr; { Parameter to NewWindow. }
  177. END;
  178. DeskMessageRecordPtr = ^DeskMessageRecord;
  179. DeskMessageRecord = RECORD
  180.     reserved : Longint;
  181.     messageType : Integer;
  182.     drawType : Integer;
  183. END;
  184.  
  185. FUNCTION AlertWindow ( alertFlags:Integer; subStrPtr:Ptr; alertStrRef:Ref) : Integer ;
  186. PROCEDURE BeginUpdate ( theWindowPtr:WindowPtr)  ;
  187. PROCEDURE BringToFront ( theWindowPtr:WindowPtr)  ;
  188. FUNCTION CheckUpdate ( theEventPtr:EventRecordPtr) : Boolean ;
  189. PROCEDURE CloseWindow ( theWindowPtr:WindowPtr)  ;
  190. FUNCTION CompileText ( subType:Integer; subStringsPtr:Ptr; srcStringPtr:Ptr; srcSize:Integer) : Handle ;
  191. FUNCTION Desktop ( deskTopOP:Integer; dtParam:Longint) : Ptr ;
  192. PROCEDURE DragWindow ( grid:Integer; startX:Integer; startY:Integer; grace:Integer; boundsRectPtr:RectPtr; theWindowPtr:WindowPtr)  ;
  193. PROCEDURE DrawInfoBar ( theWindowPtr:WindowPtr)  ;
  194. PROCEDURE EndFrameDrawing   ;
  195. PROCEDURE EndInfoDrawing   ;
  196. PROCEDURE EndUpdate ( theWindowPtr:WindowPtr)  ;
  197. FUNCTION ErrorWindow ( subType:Integer; subStringPtr:Ptr; errNum:Integer) : Integer ;
  198. FUNCTION FindWindow (VAR theWindowPtr:WindowPtr; pointX:Integer; pointY:Integer) : Integer ;
  199. FUNCTION FrontWindow  : WindowPtr ;
  200. PROCEDURE GDRPrivate   ;
  201. FUNCTION GetContentDraw ( theWindowPtr:WindowPtr) : VoidProcPtr ;
  202. FUNCTION GetContentOrigin ( theWindowPtr:WindowPtr) : Point ;
  203. FUNCTION  GetContentRgn ( theWindowPtr:WindowPtr) : RegionHndl ;
  204. FUNCTION GetDataSize ( theWindowPtr:WindowPtr) : Longint ;
  205. FUNCTION GetDefProc ( theWindowPtr:WindowPtr) : LongProcPtr ;
  206. FUNCTION GetFirstWindow  : WindowPtr ;
  207. PROCEDURE GetFrameColor (VAR colorPtr:WindColor; theWindowPtr:WindowPtr)  ;
  208. FUNCTION GetInfoDraw ( theWindowPtr:WindowPtr) : VoidProcPtr ;
  209. FUNCTION GetInfoRefCon ( theWindowPtr:WindowPtr) : Longint ;
  210. FUNCTION GetMaxGrow ( theWindowPtr:WindowPtr) : Longint ;
  211. FUNCTION GetNextWindow ( theWindowPtr:WindowPtr) : WindowPtr ;
  212. FUNCTION GetPage ( theWindowPtr:WindowPtr) : Longint ;
  213. PROCEDURE GetRectInfo (VAR infoRectPtr:Rect; theWindowPtr:WindowPtr)  ;
  214. FUNCTION GetScroll ( theWindowPtr:WindowPtr) : Longint ;
  215. FUNCTION  GetStructRgn ( theWindowPtr:WindowPtr) : RegionHndl ;
  216. FUNCTION GetSysWFlag ( theWindowPtr:WindowPtr) : Boolean ;
  217. FUNCTION  GetUpdateRgn ( theWindowPtr:WindowPtr) : RegionHndl ;
  218. FUNCTION GetWControls ( theWindowPtr:WindowPtr) : CtlRecHndl ;
  219. FUNCTION GetWFrame ( theWindowPtr:WindowPtr) : Integer ;
  220. FUNCTION GetWKind ( theWindowPtr:WindowPtr) : Integer ;
  221. FUNCTION GetWMgrPort  : WindowPtr ;
  222. FUNCTION GetWRefCon ( theWindowPtr:WindowPtr) : Longint ;
  223. FUNCTION GetWTitle ( theWindowPtr:WindowPtr) : Ptr ;
  224. FUNCTION GetWindowMgrGlobals  : Ptr ;
  225. FUNCTION GetZoomRect ( theWindowPtr:WindowPtr) : RectPtr ;
  226. FUNCTION GrowWindow ( minWidth:Integer; minHeight:Integer; startX:Integer; startY:Integer; theWindowPtr:WindowPtr) : Longint ;
  227. PROCEDURE HideWindow ( theWindowPtr:WindowPtr)  ;
  228. PROCEDURE HiliteWindow ( fHiliteFlag:Boolean; theWindowPtr:WindowPtr)  ;
  229. PROCEDURE InvalRect ( badRectPtr:Rect)  ;
  230. PROCEDURE InvalRgn ( badRgnHandle:RegionHndl)  ;
  231. PROCEDURE MoveWindow ( newX:Integer; newY:Integer; theWindowPtr:WindowPtr)  ;
  232. FUNCTION NewWindow ( theParamListPtr:ParamList) : WindowPtr ;
  233. FUNCTION NewWindow2 ( titlePtr:StringPtr; refCon:Longint; contentDrawPtr:ProcPtr; defProcPtr:ProcPtr; paramTableDesc:RefDescriptor; paramTableRef:Ref; resourceType:Integer) : WindowPtr ;
  234. FUNCTION PinRect ( theXPt:Integer; theYPt:Integer; theRectPtr:Rect) : Point ;
  235. PROCEDURE RefreshDesktop ( redrawRect:RectPtr)  ;
  236. PROCEDURE ResizeWindow ( hiddenFlag:Boolean; newRectPtr:Rect; theWindowPtr:WindowPtr)  ;
  237. PROCEDURE SelectWindow ( theWindowPtr:WindowPtr)  ;
  238. PROCEDURE SendBehind ( behindWindowPtr:WindowPtr; theWindowPtr:WindowPtr)  ;
  239. PROCEDURE SetContentDraw ( contentDrawPtr:VoidProcPtr; theWindowPtr:WindowPtr)  ;
  240. PROCEDURE SetContentOrigin ( xOrigin:Integer; yOrigin:Integer; theWindowPtr:WindowPtr)  ;
  241. PROCEDURE SetContentOrigin2 ( scrollFlag:Integer; xOrigin:Integer; yOrigin:Integer; theWindowPtr:WindowPtr)  ;
  242. PROCEDURE SetDataSize ( dataWidth:Integer; dataHeight:Integer; theWindowPtr:WindowPtr)  ;
  243. PROCEDURE SetDefProc ( wDefProcPtr:LongProcPtr; theWindowPtr:WindowPtr)  ;
  244. PROCEDURE SetFrameColor ( newColorPtr:WindColorPtr; theWindowPtr:WindowPtr)  ;
  245. PROCEDURE SetInfoDraw ( infoRecCon:VoidProcPtr; theWindowPtr:WindowPtr)  ;
  246. PROCEDURE SetInfoRefCon ( infoRefCon:Longint; theWindowPtr:WindowPtr)  ;
  247. PROCEDURE SetMaxGrow ( maxWidth:Integer; maxHeight:Integer; theWindowPtr:WindowPtr)  ;
  248. PROCEDURE SetOriginMask ( originMask:Integer; theWindowPtr:WindowPtr)  ;
  249. PROCEDURE SetPage ( hPage:Integer; vPage:Integer; theWindowPtr:WindowPtr)  ;
  250. PROCEDURE SetScroll ( hScroll:Integer; vScroll:Integer; theWindowPtr:WindowPtr)  ;
  251. PROCEDURE SetSysWindow ( theWindowPtr:WindowPtr)  ;
  252. PROCEDURE SetWFrame ( wFrame:Integer; theWindowPtr:WindowPtr)  ;
  253. PROCEDURE SetWRefCon ( wRefCon:Longint; theWindowPtr:WindowPtr)  ;
  254. PROCEDURE SetWTitle ( title:Str255; theWindowPtr:WindowPtr)  ;
  255. FUNCTION SetWindowIcons ( newFontHandle:FontHndl) : FontHndl ;
  256. PROCEDURE SetZoomRect ( wZoomSizePtr:Rect; theWindowPtr:WindowPtr)  ;
  257. PROCEDURE ShowHide ( showFlag:Boolean; theWindowPtr:WindowPtr)  ;
  258. PROCEDURE ShowWindow ( theWindowPtr:WindowPtr)  ;
  259. PROCEDURE SizeWindow ( newWidth:Integer; newHeight:Integer; theWindowPtr:WindowPtr)  ;
  260. PROCEDURE StartDrawing ( theWindowPtr:WindowPtr)  ;
  261. PROCEDURE StartFrameDrawing ( theWindowPtr:WindowPtr)  ;
  262. PROCEDURE StartInfoDrawing (VAR infoRectPtr:Rect; theWindowPtr:WindowPtr)  ;
  263. FUNCTION TaskMaster ( taskMask:Integer; taskRecPtr:WmTaskRec) : Integer ;
  264. PROCEDURE TaskMasterContent   ;
  265. FUNCTION TaskMasterDA ( eventMask:Integer; taskRecPtr:WmTaskRecPtr) : Integer ;
  266. PROCEDURE TaskMasterKey   ;
  267. FUNCTION TrackGoAway ( startX:Integer; startY:Integer; theWindowPtr:WindowPtr) : Boolean ;
  268. FUNCTION TrackZoom ( startX:Integer; startY:Integer; theWindowPtr:WindowPtr) : Boolean ;
  269. PROCEDURE ValidRect ( goodRectPtr:Rect)  ;
  270. PROCEDURE ValidRgn ( goodRgnHandle:RegionHndl)  ;
  271. PROCEDURE WindBootInit   ;
  272. FUNCTION WindDragRect ( actionProcPtr:VoidProcPtr; dragPatternPtr:Pattern; startX:Integer; startY:Integer; dragRectPtr:Rect; limitRectPtr:Rect; slopRectPtr:Rect; dragFlag:Integer) : Longint ;
  273. PROCEDURE WindNewRes   ;
  274. PROCEDURE WindReset   ;
  275. PROCEDURE WindShutDown   ;
  276. PROCEDURE WindStartUp ( userID:Integer)  ;
  277. FUNCTION WindStatus  : Boolean ;
  278. FUNCTION WindVersion  : Integer ;
  279. FUNCTION WindowGlobal ( WindowGlobalMask:Integer) : Integer ;
  280. PROCEDURE ZoomWindow ( theWindowPtr:WindowPtr)  ;
  281. IMPLEMENTATION
  282. END.
  283.